package com.jstyle.jclifexd.activity;
import android.os.Bundle;
import com.airbnb.lottie.LottieAnimationView;
import com.jstyle.jclifexd.R;
import com.jstyle.jclifexd.fragment.LoginFragment;
import com.jstyle.jclifexd.utils.StatusBarUtil;
import com.wcl.notchfit.NotchFit;
import com.wcl.notchfit.args.NotchScreenType;
import butterknife.BindView;
import butterknife.ButterKnife;

public class LoginActivity extends BaseActivity {

    @BindView(R.id.FrameLayout)
    android.widget.FrameLayout FrameLayout;
    @BindView(R.id.lottieAnimationView)
    LottieAnimationView lottieAnimationView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        ButterKnife.bind(this);
        //版本颜色适配
        StatusBarUtil.setRootViewFitsSystemWindows(this,true);
        StatusBarUtil.setTranslucentStatus(this);
        if (!StatusBarUtil.setStatusBarDarkTheme(this, false)) {
            StatusBarUtil.setStatusBarColor(this,0x00012e3d);//导航颜色
        }


     /*   lottieAnimationView.setAnimation("434-gradient-animated-background.json");
        lottieAnimationView.loop(true);
        lottieAnimationView.playAnimation();*/
   /*    final LottieDrawable drawable = new LottieDrawable();
        LottieComposition.Factory.fromAssetFileName(this, "434-gradient-animated-background.json", new OnCompositionLoadedListener() {
            @Override
            public void onCompositionLoaded(@Nullable LottieComposition composition) {
                drawable.setComposition(composition);
                drawable.playAnimation();
                drawable.loop(true);
                drawable.setScale(1.1f);
                lottieAnimationView.setImageDrawable(drawable);
            }
        });*/

        NotchFit.fit(this, NotchScreenType.TRANSLUCENT, null);

        if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction().add(R.id.FrameLayout, new LoginFragment()).commit();
        }
    }
}
